=======================================================================================================================================
Title: Custom Field: Favorite Quote

Version: 1.0

Author: John Briggs

Description:
This modification will provide an additional field to your profile and threads.

Copyright:  2009 John Briggs. All rights reserved.

Compatibility: XMB 1.9.8 SP4

Install Note: Before adding this modification to your forum you should back up all files related to this modification.

License Note: This modification is released under the GPL v3 License. A copy is provided with this software package.

Author Note: This modification is developed and released for use with XMB 1.9.8 SP4 which is provided by XMBGarage.com.

============================================================================================================================
=======
Step 1:
=======
==============================
Go To Admin Panel --> Insert Raw SQL
==============================

==========================
Paste Code Below & Click Submit:
==========================

ALTER TABLE `$table_members` ADD `favquote` varchar(75) NOT NULL default '';

============================================================================================================================
=======
Step 2:
=======
===================
Edit File: editprofile.php
===================
==========
Find Code:
==========

    $sig = postedVar('newsig', 'javascript', ($SETTINGS['sightml']=='off'), TRUE, TRUE);

===============
Add Code Below:
===============

    // Custom Field: Favorite Quote Mod Begin
    $newfavquote = postedVar('newfavquote', 'javascript', TRUE, TRUE, TRUE);
    // Custom Field: Favorite Quote Mod End

==========
Find Code:
==========

$db->query("UPDATE ".X_PREFIX."members SET status='$status',

========================================
Find Code In-Line At End Of Above Query Statement:
========================================

 WHERE username='$user'");

================
Replace Code With:
================

, favquote='$favquote' WHERE username='$user'");

============================================================================================================================
=======
Step 3:
=======
=================
Edit File: member.php
=================

==========
Find Code:
==========

loadtemplates(

===============
Add Code Below:
===============

loadtemplates(
'member_profile_favquote',

==========
Find Code:
==========

                $sig = postedVar('sig', 'javascript', ($SETTINGS['sightml']=='off'), TRUE, TRUE);

===============
Add Code Below:
===============

                // Custom Field: Favorite Quote Mod Begin
                $favquote = postedVar('favquote', 'javascript', TRUE, TRUE, TRUE);
                // Custom Field: Favorite Quote Mod End

=======================
Find Code On 1st Occurrence:
=======================

$db->query("INSERT INTO ".X_PREFIX."members (username,

=============================
Find Code In-Line In Above Statement:
=============================

) VALUES ('$username',

================
Replace Code With:
================

, favquote) VALUES ('$username',

==================================
Find Code At End Of Above Query Statement:
==================================

)");

================
Replace Code With:
================

, '$favquote')");

========================
Find Code On 2nd Occurrence:
========================

$db->query("INSERT INTO ".X_PREFIX."members (username,

=============================
Find Code In-Line In Above Statement:
=============================

) VALUES ('$username',

================
Replace Code With:
================

, favquote) VALUES ('$username',

==================================
Find Code At End Of Above Query Statement:
==================================

)");

================
Replace Code With:
================

, '')");

==========
Find Code:
==========

        $emailblock = '';
        if ($memberinfo['showemail'] == 'yes') {
            eval('$emailblock = "'.template('member_profile_email').'";');
        }

===============
Add Code Below:
===============

        // Custom Field: Favorite Quote Mod Begin
        $favquoteblock = '';
        if (!empty($memberinfo['favquote'])) {
            $memberinfo['favquote'] = censor($memberinfo['favquote']);
            eval('$favquoteblock = "'.template('member_profile_favquote').'";');
        }
        // Custom Field: Favorite Quote Mod End

============================================================================================================================
=======
Step 4:
=======
=================
Edit File: memcp.php
=================
==========
Find Code:
==========

        $sig = postedVar('newsig', 'javascript', ($SETTINGS['sightml']=='off'), TRUE, TRUE);

===============
Add Code Below:
===============

        // Custom Field: Favorite Quote Mod Begin
        $newfavquote = postedVar('newfavquote', 'javascript', TRUE, TRUE, TRUE);
        // Custom Field: Favorite Quote Mod End

==========
Find Code:
==========

$db->query("UPDATE ".X_PREFIX."members SET $pwtxt email='$email',

========================================
Find Code In-Line At End Of Above Query Statement:
========================================

 WHERE username='$xmbuser'");

================
Replace Code With:
================

, favquote='$favquote' WHERE username='$xmbuser'");

============================================================================================================================
=======
Step 5:
=======
=====================================================
Skip This Part If You DO NOT Want This Field To Display In Viewthread.
=====================================================
===================
Edit File: viewthread.php
===================
==========
Find Code:
==========

            if ($post['location'] != '') {
                $post['location'] = censor($post['location']);
                $location = '<br />'.$lang['textlocation'].' '.$post['location'];
            } else {
                $location = '';
            }

===============
Add Code Below:
===============

            // Custom Field: Favorite Quote Mod Begin
            $favquote = '';
            if (!empty($post['favquote'])) {
                $post['favquote'] = censor($post['favquote']);
                $favquote = '<br /><strong>'.$lang['favquote'].'</strong> '.$post['favquote'];
            }
            // Custom Field: Favorite Quote Mod End

==========
Find Code:
==========

            $location = '';
            $mood = '';

===============
Add Code Below:
===============

            $favquote = '';

============================================================================================================================
=======
Step 6:
=======
=======================
Edit File: lang/English.lang.php
=======================
============================
Add Code To End Of File Above ?>
============================

// Custom Field: Favorite Quote Mod Begin
$lang['favquote'] = "Favorite Quote:";
// Custom Field: Favorite Quote Mod End

============================================================================================================================
=======
Step 7:
=======
==========================
Go To Admin Panel --> Templates
==========================
===========================
Edit Template: admintool_editprofile
===========================
==========
Find Code:
==========

<tr class="tablerow">
<td bgcolor="$THEME[altbg1]" width="22%">$lang[textlocation]</td>
<td bgcolor="$THEME[altbg2]"><input type="text" name="newlocation" size="25" value="$member[location]" /></td>
</tr>

===============
Add Code Below:
===============

<tr class="tablerow">
<td bgcolor="$THEME[altbg1]" width="22%">$lang[favquote]</td>
<td bgcolor="$THEME[altbg2]"><input type="text" name="newfavquote" size="25" value="$member[favquote]" /></td>
</tr>

============================================================================================================================
=======
Step 8:
=======
==========================
Go To Admin Panel --> Templates
==========================
===========================
Edit Template: member_reg_optional
===========================
==========
Find Code:
==========

<tr class="tablerow">
<td bgcolor="$THEME[altbg1]" width="22%">$lang[textlocation]</td>
<td bgcolor="$THEME[altbg2]"><input type="text" name="location" size="25" value="" /></td>
</tr>

===============
Add Code Below:
===============

<tr class="tablerow">
<td bgcolor="$THEME[altbg1]" width="22%">$lang[favquote]</td>
<td bgcolor="$THEME[altbg2]"><input type="text" name="favquote" size="25" value="" /></td>
</tr>

============================================================================================================================
=======
Step 9:
=======
==========================
Go To Admin Panel --> Templates
==========================
=======================
Edit Template: memcp_profile
=======================
==========
Find Code:
==========

<tr class="tablerow">
<td bgcolor="$THEME[altbg1]" width="22%">$lang[textlocation]</td>
<td bgcolor="$THEME[altbg2]"><input type="text" name="newlocation" size="25" value="$member[location]" /></td>
</tr>

===============
Add Code Below:
===============

<tr class="tablerow">
<td bgcolor="$THEME[altbg1]" width="22%">$lang[favquote]</td>
<td bgcolor="$THEME[altbg2]"><input type="text" name="newfavquote" size="25" value="$member[favquote]" /></td>
</tr>

============================================================================================================================
========
Step 10:
========
==========================
Go To Admin Panel --> Templates
==========================
=====================================================
Skip This Step If You DO NOT Want This Field To Display In Viewthread.
=====================================================
========================
Edit Template: viewthread_post
========================
==========
Find Code:
==========

$location

===============
Add Code Below:
===============

$favquote

============================================================================================================================
========
Step 11:
========
==========================
Go To Admin Panel --> Templates
==========================
=======================
Edit Template: member_profile
=======================
==========
Find Code:
==========

<tr class="tablerow">
<td bgcolor="$THEME[altbg1]">$lang[textlocation]</td>
<td bgcolor="$THEME[altbg2]">$memberinfo[location]</td>
</tr>

===============
Add Code Below:
===============

$favquoteblock

============================================================================================================================
========
Step 12:
========
==========================
Go To Admin Panel --> Templates
==========================
===================================
Create New Template: member_profile_favquote
===================================
=====================
Add Code &  Click Submit:
=====================

<tr class="tablerow">
<td bgcolor="$THEME[altbg1]" width="22%">$lang[favquote]</td>
<td bgcolor="$THEME[altbg2]">$memberinfo[favquote]</td>
</tr>

============================================================================================================================
Enjoy!